<html>
    <head><title>电影列表</title></head><style type="text/css" >
        table, td, tr, th {border: 1px solid #ccc;border-collapse: collapse; font-size: 15px;}
        /*table { width: 90%; }*/
        .desc{ word-break: break-all; word-wrap: break-word; }
        .center { text-align: center;}
        td { padding-top: 10px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px;}
    </style>
    <body><h1>电影列表</h1>
        <div>
        <table><tr>
                <!--<th>编号</th>-->
                <th>名称</th>
                <th>电影简介</th>
                <th>下载地址</th>
                <th>提取密码</th>
                <th>分类</th>
                <th>大小</th>
                <th>权限</th>
                <th>状态</th>
                <th>图片地址</th>
                <th>所有者</th>
                <th>添加时间</th>
                <th>操作</th>

                {% for id,name,description,download_link,
                download_password,add_time,size,file_owner,
                permission,catalog,state,img_url 
                   in movies %}
                <tr>
                    <!--<td>{{  id }}</td>-->
                    <td>{{ name }}</td>
                    <td>{% if description %}
                        {{ description }}
                        {% endif%}
                    </td>
                    <td class="desc">{% if download_link %}
                        <a href="{{ download_link }}">查看</a>
                        {% endif %}
                    </td>
                    <td>{% if download_password %}
                        {{ download_password}}
                        {% endif %}
                    </td>
                    <td>{% if catalog %}
                        {{ catalog}}
                        {% endif %}
                    </td>
                    <td>{% if size %}
                        {{ size }}
                        {% endif %}
                    </td>
                    <td>{{ permission}}</td>
                    <td>{{ state}}</td>
                    <td>{% if img_url %}
                        <a href="{{ img_url}}">打开</a>
                        {% endif %}
                    </td>
                    <td>{% if file_owner %}
                        {{ file_owner}}
                        {% endif %}
                    </td>
                    <td>{{ add_time}}</td>
                    <td><a href="#">编辑</a> <a href="{{
                            url_for('.delete', id = id)
                            }}">删除</a></td>
                </tr>
                {% endfor %}
            </table>
            </div>
            <div style="height: 20px"></div>
            <div><a href="{{ url_for('.add')}}">添加</a></div>
            <div style="height: 20px"></div>
        </body>
    </html>
